fitting of straight line by least square method